package net.flyinggroup.si.integration;

import lombok.extern.slf4j.Slf4j;
import net.flyinggroup.si.model.CargoMessage;
import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.messaging.handler.annotation.Header;

@MessageEndpoint
@Slf4j
public class CargoServiceActivator {
    @ServiceActivator(inputChannel = "cargoTransformerOutputChannel")
    public void getCargo(CargoMessage cargoMessage, @Header("CARGO_BATCH_ID") long batchId) {
        log.debug("Message in Batch[" + batchId + "] is received with payload:" + cargoMessage);
    }
}
